package main1.v_MediatorModel2;

/**
 * Created by newtranx_011 on 2017/9/26.
 */
public class Main {
    public static void main(String[] args) {
        test();
    }

    public static void test() {
        CommonUser user1 = new CommonUser("小王");
        CommonUser user2 = new CommonUser("小陈");
        VipUser vipUser = new VipUser("小张");

        Mediator chatRoom = new ChatRoomMediator();
        chatRoom.addUser(user1);
        chatRoom.addUser(user2);
        chatRoom.addUser(vipUser);

        user2.sendMessage("hello everybody~");
        user1.sendMessage("hello everybody~");
        vipUser.sendMessage("hello everybody~");
    }
}
